package com.xdhl.fu.member.api;

import com.xdhl.fu.common.core.constant.SecurityConstants;
import com.xdhl.fu.common.core.constant.ServiceNameConstants;
import com.xdhl.fu.common.core.web.page.TableDataInfo;
import com.xdhl.fu.member.api.factory.RemoteListShuntFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 分流服务接口
 *
 * @author 朱力维
 * @time 2022/6/7 16:49
 */
@FeignClient(contextId = "remoteListShuntService", value = ServiceNameConstants.MEMBER_SERVICE, fallbackFactory =
        RemoteListShuntFallbackFactory.class)
public interface RemoteListShuntService {

    /**
     * 查询固定年龄段用户列表
     */
    @GetMapping("/basic/list/age")
    public TableDataInfo listByAge(@RequestParam("min") Integer min, @RequestParam("max") Integer max, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("pageSize") Integer pageSize, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询指定职业的用户列表
     */
    @GetMapping("/basic/list/occupation")
    public TableDataInfo listByOccupation(@RequestParam("occupation") String occupation, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("pageSize") Integer pageSize, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询n个月内活跃度用户列表
     */
    @GetMapping("/basic/list/active")
    public TableDataInfo listActive(@RequestParam("month") Integer month, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("pageSize") Integer pageSize, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
